<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <%
        String contextPath = request.getContextPath();
        String basePath = request.getScheme() + "://"
                + request.getServerName() + ":" + request.getServerPort()
                + contextPath + "/";
    %>
    <base href="<%=basePath%>">
    <meta charset="utf-8">
    <title>Title</title>
</head>
<body>
<div style="background: #94b7c4;width: 100%;height: 800px;">
    <h1><p style="color: #99ffb9;font-size: 40px;padding-top: 20px;margin: 0 auto;padding-left: 45%;">订单详情</p></h1>
    <table style="margin: 0 auto;">
        <tr>
            <td>
                <span style="font-weight: bold;">门票名称：</span>
            </td>
            <td height="70px">
                <label style="display: block;border: 2px solid #96ddff;border-radius: 10px;color: white;height: 27px;width: 358px;font-size: 16px;padding: 3px;" id="ticketName">
                </label>
            </td>
        </tr>
        <tr>
            <td width="120px;">
                <span style="font-weight: bold;">订单号：</span>
            </td>
            <td height="70px" width="80px">
                <label id="orderNo" style="display: block;border: 2px solid #96ddff;border-radius: 10px;color: white;height: 27px;width: 358px;font-size: 16px;padding: 3px;">
                    <%--<%=out_trade_no %>--%>
                </label>
            </td>
        </tr>
        <tr  id="tradeNo_tr">
            <td>
                <span style="font-weight: bold;">支付宝交易号：</span>
            </td>
            <td height="70px">
                <label style="display: block;border: 2px solid #96ddff;border-radius: 10px;color: white;height: 27px;width: 358px;font-size: 16px;padding: 3px;" id="tradeNo">
                </label>
            </td>
        </tr>
        <tr>
            <td>
                <span style="font-weight: bold;">购买数量：</span>
            </td>
            <td height="70px">
                <label style="display: block;border: 2px solid #96ddff;border-radius: 10px;color: white;height: 27px;width: 358px;font-size: 16px;padding: 3px;" id="orderNum">
                </label>
            </td>
        </tr>
        <tr>
            <td>
                <span style="font-weight: bold;">金额：</span>
            </td>
            <td height="70px">
                <label style="display: block;border: 2px solid #96ddff;border-radius: 10px;color: white;height: 27px;width: 358px;font-size: 16px;padding: 3px;" id="orderPrice">
                </label>
            </td>
        </tr>
        <tr>
            <td>
                <span style="font-weight: bold;">下单时间：</span>
            </td>
            <td height="70px">
                <label  id="orderTime"style="display: block;border: 2px solid #96ddff;border-radius: 10px;color: white;height: 27px;width: 358px;font-size: 16px;padding: 3px;">
                </label>
            </td>
        </tr>
        <tr>
            <td>
                <span style="font-weight: bold;">订单状态：</span>
            </td>
            <td height="70px">
                <label  id="orderStatus"style="display: block;border: 2px solid #96ddff;border-radius: 10px;color: white;height: 27px;width: 358px;font-size: 16px;padding: 3px;">
                </label>
            </td>
        </tr>
    </table>
</div>

<script src="js/jquery-1.11.0.min.js"></script>
<script src="js/getParameter.js"></script>
<script src="js/getDateStr.js"></script>
<script>
    $(function () {
        var orderId = getParameter("orderId");

        $.post("order/queryByOrderId", {orderId: orderId}, function (order) {
            var detailType = order.ticketTypeDetail;
            var orderStatus = ""; // 订单状态显示

            if (order.orderStatus == 0) {
                orderStatus = "已取消";
            } else if (order.orderStatus == 1) {
                orderStatus = "待付款";
            } else if (order.orderStatus == 2) {
                orderStatus = "待出行";
            } else if (order.orderStatus == 3) {
                orderStatus = "待点评";
            } else if (order.orderStatus == 4) {
                orderStatus = "已退款";
            }

            $("#ticketName").html(detailType.detailTypeName);
            $("#orderStatus").html(orderStatus);
            $("#orderPrice").html(order.payAmount);
            $("#orderNum").html(order.orderNum);
            $("#orderTime").html(getDateStr(order.createTime));
            $("#orderNo").html(order.orderId);
            var tradeNo = order.tradeNo;
            if (tradeNo == "") {
                $("#tradeNo_tr").css("display", "none");
                $("#tradeNo_tr").html(tradeNo);
            } else {
                $("#tradeNo").html(tradeNo);
            }


        });
    });

</script>
</body>
</html>
